// 卡车类
public class Truck extends Automobile {
    private String truckType;  // 卡车类型：小型、中型、大型

    // 构造方法
    public Truck(String brand, String plateNumber, String truckType) {
        super(brand, plateNumber);
        // 验证卡车类型是否有效
        if (!truckType.equals("小型") && !truckType.equals("中型") && !truckType.equals("大型")) {
            throw new IllegalArgumentException("无效的卡车类型");
        }
        this.truckType = truckType;
    }

    // 计算租金：根据类型获取日租金，再乘以天数
    @Override
    public int getRent(int days) {
        int dailyRent;
        switch (truckType) {
            case "小型":
                dailyRent = 300;
                break;
            case "中型":
                dailyRent = 350;
                break;
            case "大型":
                dailyRent = 500;
                break;
            default:
                dailyRent = 0;
        }
        return dailyRent * days;
    }
}
    